/* 基础变量 */
@import "../../style/base/base";

.nav-menu {
  width: 160px;
  font-size: 14px;
  line-height: 20px;
  cursor: pointer;
}

.nav-menu-title {
  padding-left: 10px;
  padding-right: 15px;
  width: 100%;
  height: 40px;
  line-height: 40px;
  position: relative;
  left: 0;
  top: 0;
  border-right: 1px solid #E3E2E7;
  background-color: #232D3C;
  color: #8C94A0;
}

/* 一级目录下选中状态*/
.nav-menu-title-select {
  color: $color;
}

.nav-menu-title::before, .nav-menu-title::after {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  content: '';
  background-image: url(/static/img/icon_sprite.svg);
  background-size: $icon-size;
  background-repeat: no-repeat;
  display: inline-block;
}

/* 二级目录 */
.nav-menu-content {
  background-color: #1D2530;
  border-right: 1px solid #E3E2E7;
}

.nav-menu-content p {
  width: 160px;
  color: #8C94A0;
  padding-left: 40px;
}

.nav-menu-content .nav-menu-content-select {

  background-color: $color;
  color: #fff;
  position: relative;
}

.nav-menu-content-select::after {
  content: '';
  display: inline-block;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  right: -8px;
  border: 4px solid transparent;
  border-left-color: $color;
  z-index: 100;

}

nav {
  width: 165px;
  flex-shrink: 0;
  height: 100%;
  overflow: hidden;
  background-color: #232D3C;
}

nav > div {
  width: 190px;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  border-right: 1px solid #E3E2E7;

}

/* 首页图标选中与未选择*/
.icon-index-f::before {
  background-position: -5px -5px;
  width: 13px;
  height: 14px;
  left: 16px;
}

.icon-index-t::before {
  background-position: -5px -23px;
  width: 13px;
  height: 14px;
  left: 16px;
}

/* 电梯管理选中与未选择*/

.icon-ele-manger-f::before {
  background-position: -21px -5px;
  width: 13px;
  height: 14px;
  left: 16px;
}

.icon-ele-manger-t::before {
  background-position: -21px -23px;
  width: 13px;
  height: 14px;
  left: 16px;
}

/* 故障报修选中与未选择*/

.icon-err-record-f::before {
  background-position: -37px -5px;
  width: 14px;
  height: 14px;
  left: 15px;
}

.icon-err-record-t::before {
  background-position: -37px -23px;
  width: 14px;
  height: 14px;
  left: 15px;
}

/* 维保管理选中与未选择*/
.icon-keep-man-f::before {
  background-position: -55px -5px;
  width: 14px;
  height: 14px;
  left: 15px;
}

.icon-keep-man-t::before {
  background-position: -55px -23px;
  width: 14px;
  height: 14px;
  left: 15px;
}

/* 年检管理选中与未选择*/

.icon-year-man-f::before {

  background-position: -72px -5px;
  width: 14px;
  height: 16px;
  left: 15px;
}

.icon-year-man-t::before {
  background-position: -72px -23px;
  width: 14px;
  height: 16px;
  left: 15px;
}

/* 巡查管理选中与未选择*/
.icon-examine-man-f::before {
  background-position: -87px -5px;
  width: 15px;
  height: 15px;
  left: 15px;
}

.icon-examine-man-t::before {
  background-position: -87px -23px;
  width: 15px;
  height: 15px;
  left: 15px;
}

/* 统计分析选中与未选择*/
.icon-sta-ana-f::before {
  background-position: -104px -5px;
  width: 15px;
  height: 15px;
  left: 15px;
}

.icon-sta-ana-t::before {
  background-position: -104px -23px;
  width: 15px;
  height: 15px;
  left: 15px;
}

/* 用户管理选中与未选择*/
.icon-user-man-f::before {
  background-position: -121px -5px;
  width: 15px;
  height: 15px;
  left: 15px;
}

.icon-user-man-t::before {
  background-position: -121px -23px;
  width: 15px;
  height: 15px;
  left: 15px;
}

/* 系统管理选中与未选择*/
.icon-system-man-f::before {
  background-position: -138px -5px;
  width: 15px;
  height: 15px;
  left: 15px;
}

.icon-system-man-t::before {
  background-position: -138px -23px;
  width: 15px;
  height: 15px;
  left: 15px;
}

$now-icon-size: 432px 48px;
.nav-menu-content p {
  position: relative;
  left: 0;
  top: 0;
}

.nav-menu-content p::before {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  content: '';
  background-image: url(/static/img/icon_sprite.png);
  background-size: $now-icon-size;
  background-repeat: no-repeat;
  display: inline-block;
}

%nav-icon {
  width: 24px;
  height: 24px;
  left: 15px;
}

$icon-width: 24px;
$base-left: 0px;
@for $i from 1 through 18 {
  .nav-icon-#{$i}::before {
    @extend %nav-icon;
    background-position-x: $base-left - ($icon-width) * ($i - 1);
    background-position-y: 0;
  }
}

@for $i from 1 through 18 {
  .nav-icon-select-#{$i}::before {
    @extend %nav-icon;
    background-position-x: $base-left - ($icon-width) * ($i - 1);
    background-position-y: -24px;
  }
}
